using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

namespace Yoozoo.Gameplay.City
{
    public class CityRealAiLightPassionHUD : CityRealAiHUDBase
    {
        /// <summary>
        /// 商品收入
        /// </summary>
        public TextMeshPro CashText;

        public int TotalNum;
        float Timer;
        float DisplayTime;

        public void SetCostText(int totalNum, float displayTime)
        {
            TotalNum = totalNum;
            DisplayTime = displayTime;
            Timer = 0;
        }

        void Update()
        {
            Timer += Time.deltaTime;
            if (Timer > DisplayTime)
            {
                Timer = DisplayTime;
            }
            CashText.text = $"+{Mathf.Floor(TotalNum*(Timer/DisplayTime))}";
        }
        
    }
}
